Object Properties
The accessible information in an object is its set of properties. Object properties are like the fields of a structure, except that they are accessible only through function calls; you cannot read them directly. Each property consists of a value or a list of values; the definition of the property determines what it contains. For example, the shape type property of a shape object contains a value, such as gxRectangleType, that describes the type of shape that it is.For most properties, QuickDraw GX provides
GXGetObjectProperty
andGXSetObjectProperty
functions that allow you to get or set each accessible part of
the object. For example, the following statement returns a shape object's type into
themyShapeType
variable:
myShapeType = GXGetShapeType(myShape);Figure 1-13 on page 1-49 lists the accessible properties of the principal QuickDraw GX objects other than printing objects. Note that, because they are properties and not fields, their order in Figure 1-13 is arbitrary. The properties are explained in more detail in the chapter that describes the object.Some object properties are common to most kinds of objects. For example, many
objects have properties that are simply references to other objects. In addition,
many objects have attributes, an owner count, and a tag list. These four kinds of common properties are summarized in this section.References
Some properties consist of references to other objects. These references define a relationship between the objects; the properties of the referenced object are like an extension to the properties of the object containing the reference. For example, Figure 1-2 on page 1-12 shows three objects referenced by a shape object: a style object, an ink object, and a transform object. Those three objects' properties affect how the shape that references them is drawn; the ink object, for example, defines the color of the shape.Many objects contain references to other objects. Some object properties are individual references, whereas other properties are arrays, or lists, of references to several objects. The advantages of using object references are discussed in the section "Sharing and Multiple Object References" beginning on page 1-19.
- Note
- In illustrations of object properties throughout the QuickDraw GX documentation, properties that are object references (or lists of object references) are represented in italics. See, for example, how the style, ink and transform properties of the shape object are represented in
Figure 1-13 on page 1-49.![]()
Attributes
Some objects have an attributes property, which is a group of flags that you use to modify the behavior of the object. In shapes, for example, these flags allow you to specify--among other things--how QuickDraw GX stores the shape object and how editing operations affect the shape object. In view ports, as another example, these flags allow you to specify behavior such as whether or not to perform color matching when drawing.Owner Count
For objects that are shared, this property indicates how many references to the object exist. For example, when you create a new shape object, QuickDraw GX sets the owner count of the new shape to 1. If you add that shape to a picture, QuickDraw GX increments the shape's owner count by 1. If you dispose of the picture, QuickDraw GX decrements the shape's owner count by 1. Whenever the owner count of a shared object reaches 0, the object is deleted and its memory released.Owner counts are discussed further in the section "Sharing and Multiple Object References" beginning on page 1-19.
Tag List
This property is an array of references to custom information stored in tag objects. Tag objects are discussed further in the section "Adding Custom Behavior With Tag Objects," on this page.